<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

Route::get('/', function () {
    return view('welcome');
});


//搭建后台
Route::get('/admin/index/index','Admin\IndexController@index');

//登陆后台
Route::get('/admin/denglu/denglu','Admin\DengluController@denglu');
Route::post('/admin/denglu/dodenglu','Admin\DengluController@dodenglu');

//用户管理
Route::get('/admin/user/add','Admin\UserController@add');
Route::post('/admin/user/insert','Admin\UserController@insert');
Route::get('/admin/user/index','Admin\UserController@index');
Route::get('/admin/user/edit/{id}','Admin\UserController@edit');
Route::post('/admin/user/update','Admin\UserController@update');
Route::get('/admin/user/delete/{id}','Admin\UserController@delete');
Route::post('/admin/user/checkuser','Admin\UserController@checkuser');

//文章管理
Route::resource('/admin/article','admin\ArticleController');



//重置密码
// Route::get('/forget','Home\ResetController@forget');
// Route::get('/reset','Home\ResetController@reset');
// Route::post('/send','Home\ResetController@send');
// Route::get('/info','Home\ResetController@info');
// Route::get('/new/id/{id}/token/{token}','Home\ResetController@newform');
// Route::post('/update','Home\ResetController@update');

//重置密码
// Route::get('/forget','Home\ResetController@forget');忘记密码
Route::get('/reset','Home\ResetController@reset');	//输入邮件页面
Route::post('/send','Home\ResetController@send');	//发邮件处理页面
Route::get('/info','Home\ResetController@info');	//发邮件页面
Route::get('/success','Home\ResetController@success');	//密码修改成功页面
Route::get('/new/id/{id}/token/{token}','Home\ResetController@newform');
Route::post('/update','Home\ResetController@update');
Route::post('/checkuser','Home\ResetController@checkuser'); //ajax验证


//用户注册
 Route::get('/home/user/add','Home\UserController@add');
 Route::post('/home/user/insert','Home\UserController@insert');
 Route::post('/home/user/checkuser','Home\UserController@checkuser');
 Route::get('/home/user/denglu','Home\UserController@denglu');	//登陆页面
 Route::post('/home/user/dodenglu','Home\UserController@dodenglu');	//登陆页面
 Route::get('/createcode','Home\UserController@createCode');	//验证码

 
//分类管理
Route::get('/admin/cate/add','Admin\CateController@add');
Route::post('/admin/cate/insert','Admin\CateController@insert');
Route::get('/admin/cate/index','Admin\CateController@index');
Route::get('/admin/cate/edit/{id}','Admin\CateController@edit');
Route::post('/admin/cate/update','Admin\CateController@update');
Route::get('/admin/cate/delete/{id}','Admin\CateController@delete');

//递归查询无限分类
// Route::get('/admin/cate/test/','Admin\CateController@test');
// Route::get('/admin/cate/mytest/','Admin\CateController@mytest');

//商品管理
Route::get('/admin/goods/add','Admin\GoodsController@add');
Route::post('/admin/goods/insert','Admin\GoodsController@insert');
Route::get('/admin/goods/index','Admin\GoodsController@index');
Route::get('/admin/goods/edit/{id}','Admin\GoodsController@edit');
Route::post('/admin/goods/update','Admin\GoodsController@update');
Route::get('/admin/goods/delete/{id}','Admin\GoodsController@delete');

//订单管理
Route::get('/admin/order/index','Admin\OrderController@index');
Route::get('/admin/order/edit/{id}','Admin\OrderController@edit'); 
Route::get('/admin/order/delete/{id}','Admin\OrderController@delete'); 
Route::get('/admin/order/detail/{id}','Admin\OrderController@detail');


//后台商品属性管理
Route::get('/admin/goodsattr/add','Admin\GoodsattrController@add');
Route::post('/admin/goodsattr/insert','Admin\GoodsattrController@insert');
Route::get('/admin/goodsattr/index','Admin\GoodsattrController@index');
Route::get('/admin/goodsattr/edit/{id}','Admin\GoodsattrController@edit');
Route::post('/admin/goodsattr/update','Admin\GoodsattrController@update');
Route::get('/admin/goodsattr/delete/{id}','Admin\GoodsattrController@delete');

//后台商品属性详情管理
Route::get('/admin/goodsattrdetails/add','Admin\GoodsattrdetailsController@add');
Route::post('/admin/goodsattrdetails/insert','Admin\GoodsattrdetailsController@insert');
Route::get('/admin/goodsattrdetails/index','Admin\GoodsattrdetailsController@index');
Route::get('/admin/goodsattrdetails/edit/{id}','Admin\GoodsattrdetailsController@edit');
Route::post('/admin/goodsattrdetails/update','Admin\GoodsattrdetailsController@update');
Route::get('/admin/goodsattrdetails/delete/{id}','Admin\GoodsattrdetailsController@delete');


//前台首页
Route::get('/home/index/index','Home\indexController@index');
Route::get('/home/index/index2/{cid?}','Home\indexController@index2');
Route::get('/home/index/search','Home\indexController@search');
Route::post('/home/index/ajax1','Home\indexController@ajax1');
Route::post('/home/index/ajax2','Home\indexController@ajax2');
Route::post('/home/index/ajax3','Home\indexController@ajax3');
Route::post('/home/index/ajax4','Home\indexController@ajax4');
Route::post('/home/index/search','Home\indexController@search');

// Route::post('/home/index/ajax10','Home\indexController@ajax10');
// Route::get('/home/index/test','Home\indexController@test');

//网站管理
Route::get('/admin/config/index','Admin\ConfigController@index');
Route::post('/admin/config/update','Admin\ConfigController@update');

//友情链接
Route::get('/admin/link/add','Admin\LinkController@add');
Route::post('/admin/link/insert','Admin\LinkController@insert');
Route::get('/admin/link/index','Admin\LinkController@index');
Route::get('/admin/link/edit/{id}','Admin\LinkController@edit');
Route::post('/admin/link/update','Admin\LinkController@update');
Route::get('/admin/link/delete','Admin\LinkController@delete');

//轮播图
Route::get('/admin/lunbo/index','Admin\LunboController@index');
Route::post('/admin/lunbo/update','Admin\LunboController@update');


//卖家管理
Route::get('/admin/seller/add','Admin\SellerController@add');
Route::post('/admin/seller/insert','Admin\SellerController@insert');
Route::get('/admin/seller/index','Admin\SellerController@index');
Route::get('admin/seller/edit/{id}','Admin\SellerController@edit');
Route::post('admin/seller/update','Admin\SellerController@update');
Route::get('admin/seller/delete/{id}','Admin\SellerController@delete');
// ROute::get('admin/seller/testadd','Admin\SellerController@testadd');

//卖家注册登录
Route::get('/home/seller/add','Home\SellerController@add');
Route::post('/home/seller/insert','Home\SellerController@insert');
Route::post('/home/seller/checkuser','Home\SellerController@checkuser');
Route::get('/home/seller/denglu','Home\SellerController@denglu');	//登陆页面
Route::post('/home/seller/dodenglu','Home\SellerController@dodenglu');	//登陆页面
Route::get('/createcode','Home\SellerController@createCode');	//验证码

//后台店铺管理
Route::get('/admin/shop/add','Admin\ShopController@add');
Route::post('/admin/shop/insert','Admin\ShopController@insert');
Route::get('/admin/shop/index','Admin\ShopController@index');
Route::get('/admin/shop/edit/{id}','Admin\ShopController@edit');
Route::post('/admin/shop/update','Admin\ShopController@update');
Route::get('/admin/shop/delete/{id}','Admin\ShopController@delete');

//判断商品属性
Route::post('/admin/goods/check','Admin\CheckController@check');
Route::post('/admin/goods/check1','Admin\CheckController@check1');
Route::post('/admin/goods/check2','Admin\CheckController@check2');
Route::post('/admin/goods/check3','Admin\CheckController@check3');

//后台广告位
Route::get('/admin/guanggao/add','Admin\GuanggaoController@add');
Route::post('/admin/guanggao/insert','Admin\GuanggaoController@insert');
Route::get('/admin/guanggao/index','Admin\GuanggaoController@index');
Route::get('/admin/guanggao/edit/{id}','Admin\GuanggaoController@edit');
Route::post('/admin/guanggao/update','Admin\GuanggaoController@update');
Route::get('/admin/guanggao/delete/{id}','Admin\GuanggaoController@delete');


Route::get('/home/goods/details/{id}','Home\DetailsController@show');	//物品详情页
Route::get('/home/shop/details/{id}','Home\Shop_DetailsController@index');	//物品详情页
Route::post('/home/details/insert','Home\DetailsController@insert');	//加入购物车
Route::get('/home/user/push','Home\UserController@push'); //清除session

//前台用户中心
Route::get('/home/user/details','Home\UserController@details');
Route::get('/home/user/userinfo','Home\UserController@userinfo');
Route::get('/home/seller/details','Home\sellerController@details');

//前台卖家商品发布
Route::get('/home/goods/add','Home\GoodsController@add');
Route::post('/home/goods/insert','Home\GoodsController@insert');
Route::get('/home/goods/index','Home\GoodsController@index');
Route::get('/home/goods/edit/{id}','Home\GoodsController@edit');
Route::post('/home/goods/update','Home\GoodsController@update');
Route::get('/home/goods/delete/{id}','Home\GoodsController@delete');

//评价管理
Route::get('/admin/pingjia/index','Admin\PingjiaController@index');
Route::get('/admin/pingjia/edit/{id}','Admin\PingjiaController@edit');
Route::post('/admin/pingjia/update','Admin\PingjiaController@update');
Route::get('/admin/pingjia/delete/{id}','Admin\PingjiaController@delete');
//前台评价
Route::get('/home/pingjia/add','Home\PingjiaController@add');
Route::post('/home/pingjia/insert','Home\PingjiaController@insert');
Route::get('/home/pingjia/index','Home\PingjiaController@index');

